package com.d3works.apps.hr.service.employee;

import com.d3works.apps.base.service.user.UserService;
import com.d3works.apps.hr.db.DPAE;
import com.d3works.apps.hr.db.Employee;
import com.d3works.exception.D3worksException;
import com.google.inject.persist.Transactional;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Map;

public interface EmployeeService extends UserService {

  public int getLengthOfService(Employee employee, LocalDate refDate) throws D3worksException;

  public int getAge(Employee employee, LocalDate refDate) throws D3worksException;

  public BigDecimal getDaysWorksInPeriod(Employee employee, LocalDate fromDate, LocalDate toDate)
      throws D3worksException;

  public Map<String, String> getSocialNetworkUrl(String name, String firstName);

  /** Generates a new {@link DPAE} for given {@link Employee} and returns its id. */
  @Transactional(rollbackOn = {Exception.class})
  Long generateNewDPAE(Employee employee) throws D3worksException;
}
